<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>我的预约 - 光大好车</title>
	<meta content="光大好车" name="keywords" />
	<meta content="光大好车" name="description" />
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="iconfont/iconfont.css">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" type="text/css" href="css/style3.css">
	<!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
	<script type="text/javascript" src="script/jquery.js"></script>
	<script type="text/javascript" src="script/bootstrap.min.js"></script>
	<script type="text/javascript" src="script/layer.js"></script>
	<script language="JavaScript">
		$(function () {
			$('.carnum').delay(2000).hide(0);
			$('.nextpage').click(function () {
				var nextpage = parseInt($("input[name=nextpage]").val());
				var page = parseInt($("input[name=page]").val());
				$.get("" + nextpage,
					function (data, textStatus) {
						if (data != '') {
							$("#listcar").append(data);
							$("input[name=page]").val(1);
						} else {
							$("#pagestatus").show().html("加载完毕，已没有更多预约信息");
							$(".nextpage").hide();
						}
					}
				);
				$("input[name=nextpage]").val(nextpage + 1);
			});
		})
	</script>
</head>

<body>
	<div class="black_overlay"></div>
	<!--内容-->
	<header class="mo-header">
		<div class="mo-header-left"> <a href="#"> 首页 </a> <i class="iconfont">&#xe61d;</i> <a href="#"> 会员中心 </a> <i
				class="iconfont">&#xe61d;</i> <a href="#"> 我的预约 </a> </div>
	</header>
	<div class="myreport">
		<span class="car" onclick="car()">轿车</span>
		<span class="truck" onclick="truck()">货车</span>
	</div>
	<div>
		<!--<div class="listcar" onclick="info();return false;">
		    <div class="carimg"> 
		    	<a href="#" target="_blank"><img data-original="img/carimg.jpg" width="300" height="230" class="img-responsive lazy"/></a>
		    </div>
		    <div class="carinfo">
		          <h4><a href="#" target="_blank">奥迪A4L 2013款 奥迪A4L 30 TFSI 自动 舒适型</a> </h4>
		          <p class="caritem"> 上牌 / 20.00万公里</p>
		          <span class="carprice">29.10万元</span>
		    </div>
	    </div>-->
	</div>
	<div id="listcar"></div>
	<div id="pagestatus" style="display:none;"></div>
	<!--<a href="javascript:;" id="returntop"></a> -->
	<script type="text/javascript" src="script/jquery.lazyload.js"></script>
	<script src="js/mui.min.js"></script>
	<script src="js/mui.js"></script>
	<script src="js/mui.picker.min.js"></script>
	<script src="js/mui.picker.js"></script>
	<script src='js/feedback.js'></script>
	<script src="js/app.js"></script>
	<script type="text/javascript" charset="utf-8">
		$(function () {
			$("img.lazy").lazyload({
				effect: "fadeIn"
			});
			/*$('#returntop').click(function(){$('html,body').animate({scrollTop: '0px'}, 1000);return false;});*/
		});
	</script>
	<script>
		window.onload = function () {
			var telephone = window.localStorage.getItem("telephone");
			car();
		}

		function car() {
			var telephone = window.localStorage.getItem("telephone");
			//var url = servicePath+"sechandcar/app/sys/selectMyCarCollection";
			$.ajax({
				url: servicePath + "sechandcar/app/sys/selectMyCarCollection",
				async: false,
				type: "post",
				dataType: "json",
				data: {
					"telephone": telephone
				},
				success: function (data) {
					//alert(url);
					//alert(data);
					$('#listcar').empty();
					for (var i = 0; i < data.length; i++) {
						//window.alert(data[i].id);
						var s = '<input type="hidden" name="id" id="id"/>';
						var dz = "cardetail.html?id=" + data[i].id;
						s += '<a href="' + dz + '"><div class="listcar">' +
							'<div class="carimg"><img src="' + servicePath + '' + data[i].photo1 +
							'" class="img-responsive lazy" /> </div>' +
							'<div class="carinfo">' +
							'<h4>' + data[i].brandmodel + '</h4>' +
							'<p class="caritem">' + data[i].registrationdate + ' 上牌/ ' + data[i].mileage + '万公里</p>' +
							'<span class="carprice">￥' + data[i].wholesaleprice + '万元</span>' +
							'</div>' +

							'</div></a>';
						$('#listcar').append(s);
						//alert($('#listcar'))
						$("input[name='id']").val(data[i].id);
						//window.alert($("input[name='id']").val());
					}
				},
				error: function (data) {
					window.alert("111错误");
					//window.alert(data);
				}
			});
		}

		function showcardetail(id) {
			mui.openWindow({
				id: 'cardetails',
				url: 'cardetail.html',
				createNew: true,
				waiting: {
					autoShow: true,
					title: '正在加载...',
				},
				extras: {
					ids: id
				}
			});
		}
		//var url = servicePath+"sechandcar/app/sys/selectMyTruckCollection";
		//alert(url);
		//alert(telephone);
		function truck() {
			var telephone = window.localStorage.getItem("telephone");
			$.ajax({
				url: servicePath + "sechandcar/app/sys/selectMyTruckCollection",
				async: false,
				type: "post",
				dataType: "json",
				data: {
					"telephone": telephone
				},
				success: function (data) {
					//window.alert(data);
					$('#listcar').empty();
					for (var i = 0; i < data.length; i++) {
						var s = '<div class="listcar">';
						var dz = "truckdetail.html?id=" + data[i].id;
						s += '<a href="' + dz + '"><div class="listcar">' +
							'<div class="carimg"><img src="' + servicePath + '' + data[i].photo1 +
							'"  class="img-responsive lazy" /> </div>' +
							'<div class="carinfo">' +
							'<h4>' + data[i].brandmodel + '</h4>' +
							'<p class="caritem">' + data[i].registrationdate + ' 上牌/ ' + data[i].mileage + '万公里</p>' +
							'<span class="carprice">￥' + data[i].wholesaleprice + '万元</span>' +
							'</div>' +
							'</div></a>';
						$('#listcar').append(s);
					}
				},
				error: function (data) {
					window.alert("1111111错误");
					//window.alert(data);
				}
			});
		}

		function showtruckdetail(id) {
			mui.openWindow({
				id: 'truckdetails',
				url: 'truckdetail.html',
				createNew: true,
				waiting: {
					autoShow: true,
					title: '正在加载...',
				},
				extras: {
					ids: id
				}
			});
		}
	</script>
	<script>
		function info(id) {
			$.ajax({
				url: servicePath + "sechandcar/app/sys/selectCarInfo",
				async: false,
				type: "post",
				dataType: "json",
				//data: {"id":$("input[name='id']").val()},
				data: {
					"id": id
				},
				success: function (data) {
					//window.location.href = "infor.html";
					window.location.href("info.html?id=id");
				},
				error: function (data) {
					window.alert("s错误");
					//window.alert(data);
				}
			});
		}
	</script>
	<script>
		function cardetail(id) {
			window.location.href = "carinfo.html?id=" + id;
			//"./punch/clock_frm.html?modFlag="+modFlag+'&role='+role;
		}
	</script>
	<script>
		function truckdetail(id) {
			window.location.href = "truckinfo.html?id=" + id;
			//"./punch/clock_frm.html?modFlag="+modFlag+'&role='+role;
		}
	</script>
</body>

</html>